package com.serviceprovider.business.module.admin.user.dao.interfaces;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.role.model.Role;
import com.serviceprovider.business.module.common.Page;
import com.serviceprovider.business.module.user.model.impl.User;
import com.serviceprovider.business.module.user.model.impl.UserSearchCriteria;

//~--- JDK imports ------------------------------------------------------------

import java.util.Collection;
import java.util.List;

/**
 * @Leonardo A. Auer
 *
 * @since 04/11/2011
 */
public interface IUserDao {
    public Page<User> findUserByRole(Role role, int pageNumber, int recordSize, String sortColumn, String sortOrder);

    public User findUserById(int userId);

    public User findUserByEFIN(int efin);

    public User findUserBySSN(int ssn);

    public User findUserByUsername(String username);

    public Page<User> findUserByCity(String city, int pageNumber, int recordSize, String sortColumn, String sortOrder);

    public Page<User> findUserByZipCode(String zipCode, int pageNumber, int recordSize, String sortColumn,
            String sortOrder);

    /**
     * Please note "county" is different than "country". Look up encyclopedia
     * for more info on "county".
     */
    public Page<User> findUserByCounty(String county, int pageNumber, int recordSize, String sortColumn,
                                       String sortOrder);

    public Page<User> findUserByCountry(String country, int pageNumber, int recordSize, String sortColumn,
            String sortOrder);

    public User findUserByUsernamePassword(String firstName, String middleName, String lastName, String password);

    public Page<User> findUserByCriteria(UserSearchCriteria criteria, int pageNumber, int recordSize,
            String sortColumn, String sortOrder);

    public Page<User> findAllUsers(int pageNumber, int recordSize, String sortColumn, String sortOrder);

    public Page<User> findUsersById(List<Integer> ids, int pageNumber, int recordSize, String sortColumn,
                                    String sortOrder);

    public List<User> findUsersById(Collection<Integer> ids);

    public Page<User> findUsersByLevel1User(int level1UserId, int pageNumber, int recordSize, String sortColumn,
            String sortOrder);

    public Page<User> findUsersByRoleAndLevel1User(int role, int level1UserId, int pageNumber, int recordSize,
            String sortColumn, String sortOrder);

    /**
     * Retrieves from database the corresponding Level1User for the users in the
     * list.
     */
    public void retrieveLevel1User(List<User> userList);

    /**
     * Retrieves from database the corresponding Level1User for the user
     * parameter
     */
    public void retrieveLevel1User(User user);

    /*
     * CRUD functions
     */
    public User insertUser(User user);

    public void updateUser(User user);

    public void deleteUser(int userId);

    public void deleteUser(List<Integer> usersId);

    public void undeteleUser(int userId);

    public void undeteleUser(List<Integer> usersId);

    public void updateActiveStatus(int userId, boolean status);

    public void updateActiveStatus(List<Integer> usersId, boolean status);

    public void updateInGuiFlag(List<Integer> usersId, boolean status);

    public void updatePassword(int userId, String password);

    public List<Long> getAllNonMatchingIds(Integer roleId);

    public void updateAllUsersActiveFlag(Integer roleId, Boolean isActive);
}



